<!DOCTYPE html>
<html>
<head>
<meta charset="ISO-8859-1">
<title></title>
	 <link rel="stylesheet" href="../jquery.mobile/jquery.mobile-1.0b2.css" type="text/css" charset="utf-8" />
	 <link rel="stylesheet" href="../css/brumpolo.css" type="text/css" charset="utf-8" />
	  <!-- <link rel="stylesheet" href="pgandjqm-style-override.css" type="text/css" charset="utf-8" />  -->
	  <script type="text/javascript" src="../jquery.mobile/jquery-1.6.2.min"></script>
	  <script type="text/javascript" charset="utf-8" src="../phonegap-1.0.0.js"></script>
	  <script src="../jquery.mobile/jquery.mobile-1.0b2.js"></script>
	  <!-- <script type="text/javascript" charset="utf-8" src="../main.js"></script>-->
	  <script type="text/javascript" charset="utf-8" src="../js/brumpolo.js"></script>
  
	<!-- CDN Respositories: For production, replace lines above with these uncommented minified versions -->
	<!-- <link rel="stylesheet" href="http://code.jquery.com/mobile/1.0b2/jquery.mobile-1.0b2.min.css" />-->
	<!-- <script src="http://code.jquery.com/jquery-1.6.2.min.js"></script>-->
	<!-- <script src="http://code.jquery.com/mobile/1.0b2/jquery.mobile-1.0b2.min.js"></script>-->
	
	<script type="text/javascript">
			function appReady(){
				var ajax = new XMLHttpRequest();
				ajax.open("GET","http://search.twitter.com/search.json?q=salamtura",true);
				ajax.send();

				ajax.onreadystatechange=function(){
					if(ajax.readyState==4 && (ajax.status==200||ajax.status==0)){
						eval('var data = ' + ajax.responseText + ';');
						var theResults = data.results;
						var theHTML = '';
						for(var i=0;i<theResults.length;i++){
							theHTML += ['<div class="tweet"',
											'<div class="avatar"> <img src='+theResults[i].profile_image_url+' /></div>',
											'<div class="tweet_content">',
												'<h2>'+theResults[i].from_user+'</h2>',
												'<p>'+theResults[i].text+'</p>',
											'</div>',
										'</div>'].join('');
						}
						document.getElementById('main-tweets').innerHTML = theHTML;
					}
				}
			}
            function initTweets(){            	
            	document.addEventListener("deviceready", appReady, true);
            }
			

        </script>

		<style type="text/css">
			.tweet {padding-bottom:5px;}
			.avatar {float: left; height: 48px; width: 48px;}
			.tweet_content {margin-left: 60px; min-height: 48px;}
		</style>
		
</head>
<body onload="initTweets()">
	<div data-role="page" data-theme="b" >		
	    <div data-role="header" data-position="inline"  data-theme="b">
			<a href="index.html" data-icon="home">Home</a>
			<h1>Live Tweets</h1>			
		</div>
	    <div data-role="content">
	       	<div id="main-tweets">
			</div>
	    </div>
	    <div data-role="footer" class="ui-bar">
	    	&copy 2012 UBPC.
	    </div>
	</div>
</body>
</html>